package com.jandan.ui.client.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
import com.jandan.ui.model.LearnedData;
import com.jandan.ui.model.LearnedWord;
import com.jandan.ui.model.Lesson;
import com.jandan.ui.model.ReviewInfo;
import com.jandan.ui.model.Word;

public interface LessonService extends RemoteService {

	public static final String SERVICE_URI = "lesson.rpc";

	public static class Util {

		public static LessonServiceAsync getInstance() {

			LessonServiceAsync instance = (LessonServiceAsync) GWT
					.create(LessonService.class);
			ServiceDefTarget target = (ServiceDefTarget) instance;
			target.setServiceEntryPoint(GWT.getModuleBaseURL() + SERVICE_URI);
			return instance;
		}
	}
	public List<Lesson> getLessonList();

	public Lesson insertLesson(Lesson lesson);

	public void deleteLesson(long lessonID);
	
	public void writeback(List<LearnedWord> words);

	public Lesson getLesson(long lessonID);

	public List<Word> getWordListByLessonIDAndLibNumber(long lessonID,int libNumber);
	
	public List<Word> getNewWordList(long lessonID,int libNumber);
	
	public List<LearnedWord> getLearnedWordList(long lessonID);
	
	public List<LearnedWord> getLearnedWordList(long lessonID,int libNumber);
	
	public Map<String,List> getNewWordAndLearnedWordListByLessonID(long lessonID,int libNumber);

	public ReviewInfo getTodayReviewInfo(long lessonID);

	public ReviewInfo getReviewInfoOfSomeDay(long lessonID,Date date);

	public List<ReviewInfo> getReviewInfoListByToday(long lessonID);
	
	public List<ReviewInfo> getReviewInfoList(long lessonID);
	
	public List<LearnedWord> getTodayReviewLearnedWordList(long lessonID);
	
	public List<LearnedWord> getReviewLearnedWordList(long lessonID, List<Date> dateList);
	
	public void updateLesson(Lesson lesson);
	
	public LearnedData getLearnedData(long lessonID);


}
